package com.iwhalecloud.bss.kite.cucc.service.pos.handler;

import com.iwhalecloud.bss.kite.cucc.client.dto.cust.CuccContextCustDTO;
import com.iwhalecloud.bss.kite.cucc.client.dto.pos.KitePosDTO;
import com.iwhalecloud.bss.kite.cucc.client.dto.pos.KitePosGoodsDTO;
import com.iwhalecloud.bss.kite.cucc.client.dto.scene.CuccCustInfoDTO;
import com.iwhalecloud.bss.kite.cucc.service.pos.bo.KitePosSceneBO;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class KitePosHandlerContext {

	private String sceneInstId;

	private String custId;

	private String staffId;

	private String orgId;

	private String lanId;

	private Boolean checkAccountModule;

	private Boolean checkContractModule;

	private KitePosSceneBO posSceneBO;

	protected CuccContextCustDTO custDto;

	protected KitePosDTO posDto = new KitePosDTO();

	protected List<IKitePosSceneHandler> posHandlers = new ArrayList<>();

    // 是否归属BCMC流程,true表示是，false表示否
    private Boolean isBcmcFlow;

    /**
     * 新客户信息（主要用户过户）
     */
    protected CuccCustInfoDTO newCustDto;

    /**
     * 批量受理当前记录的主套餐offerInstId
     */
    private String offerInstId;

    /**
     * 操作类型:URGENT（加急）、POSTPONE（延期）、LOCK（挂起）、RELEASE（解挂）、ALTER（追单）、CANCEL（退单）
     */
    private String opType;

	public String getSceneInstId() {
		return sceneInstId;
	}

	public void setSceneInstId(String sceneInstId) {
		this.sceneInstId = sceneInstId;
	}

	public String getCustId() {
		return custId;
	}

	public void setCustId(String custId) {
		this.custId = custId;
	}

	public String getStaffId() {
		return staffId;
	}

	public void setStaffId(String staffId) {
		this.staffId = staffId;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public String getLanId() {
		return lanId;
	}

	public void setLanId(String lanId) {
		this.lanId = lanId;
	}

	public KitePosSceneBO getPosSceneBO() {
		return posSceneBO;
	}

	public void setPosSceneBO(KitePosSceneBO posSceneBO) {
		this.posSceneBO = posSceneBO;
	}

	public CuccContextCustDTO getCustDto() {
		return custDto;
	}

	public void setCustDto(CuccContextCustDTO custDto) {
		this.custDto = custDto;
	}

    public Boolean getCheckAccountModule() {
        return checkAccountModule;
    }

    public void setCheckAccountModule(Boolean checkAccountModule) {
        this.checkAccountModule = checkAccountModule;
    }

    public Boolean getCheckContractModule() {
        return checkContractModule;
    }

    public void setCheckContractModule(Boolean checkContractModule) {
        this.checkContractModule = checkContractModule;
    }

    public KitePosDTO getPosDto() {
		if (Objects.isNull(posDto)) {
			posDto = new KitePosDTO();
		}
		return posDto;
	}

	public void setPosDto(KitePosDTO posDto) {
		this.posDto = posDto;
	}

	public void addGoods(KitePosGoodsDTO goods) {
		List<KitePosGoodsDTO> goodsList = this.posDto.getGoods();
		if (goodsList == null) {
			goodsList = new ArrayList<>();
		}
		goodsList.add(goods);
		this.posDto.setGoods(goodsList);
	}

	public List<IKitePosSceneHandler> getPosHandlers() {
		return posHandlers;
	}

	public void setPosHandlers(List<IKitePosSceneHandler> posHandlers) {
		this.posHandlers = posHandlers;
	}

    public Boolean getIsBcmcFlow() {
        return isBcmcFlow;
    }

    public void setIsBcmcFlow(Boolean isBcmcFlow) {
        this.isBcmcFlow = isBcmcFlow;
    }

    public CuccCustInfoDTO getNewCustDto() {
        return newCustDto;
    }

    public void setNewCustDto(CuccCustInfoDTO newCustDto) {
        this.newCustDto = newCustDto;
    }

    public String getOfferInstId() {
        return offerInstId;
    }

    public void setOfferInstId(String offerInstId) {
        this.offerInstId = offerInstId;
    }

    public String getOpType() {
        return opType;
    }

    public void setOpType(String opType) {
        this.opType = opType;
    }
}
